* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
}
body {
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
  padding: 20px;
}
.container {
  max-width: 600px;
  margin: 0 auto;
  background: rgb(250, 250, 250);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* 头部 */
header {
  text-align: center;
  padding: 30px 20px 15px;
}
h1 {
  font-size: 2rem;
  color: #4a6cf7;
  margin-bottom: 8px;
}
.subtitle {
  color: #666;
  font-size: 0.95rem;
}
/* 核心区域 */
.core-section {
  margin: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgb(255, 255, 255);
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}
/* 输入区域 */
.input-group {
  display: flex;
  gap: 8px;
  padding: 0 20px 20px;
  margin-top: 16px;
}
#todoInput {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}
#todoInput:focus {
  border-color: #4a6cf7;
}
#addBtn {
  padding: 12px 16px;
  background: #4a6cf7;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
#addBtn:hover {
  background: #3a5bf5;
}

/* 过滤按钮组 */
.filters {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 20px 15px;
}
.filter-btn {
  padding: 6px 16px;
  background: #f0f2f5;
  color: #555;
  border: 2px solid #555;
  border-radius: 20px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn.active {
  color: #4a6cf7;
}

/* 待办事项列表 */
#todoList {
  list-style: none;
  padding: 0 20px 20px;
}
.todo-item {
  display: flex;
  align-items: center;
  height: 70px;
  padding: 12px 10px;
  margin-top: 10px;
  background: rgb(250, 250, 250);
  border-radius: 5px;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.3s, transform 0.3s;
}
.todo-item.leaving {
  opacity: 0;
  transform: translateX(100px);
}
.todo-checkbox {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  margin-right: 12px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  border: 1px solid #ddd;
  border-radius: 3px;
}

.todo-checkbox:checked {
  background:#4a6cf7; /* 选中时的背景颜色 */
  position: relative;
}

/* 像素级创建勾号 */
.todo-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.todo-text {
  flex: 1;
  font-size: 0.95rem;
  word-break: break-word;
}
/* 增加已完成的删除线和变色 */
.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: #999;
}
.delete-btn {
  background: none;
  border: none;
  color: #ff0000;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.delete-btn:hover {
  opacity: 1;
}

/* 底部统计栏 */
.stats {
  padding: 30px;
  margin: 10px;
  margin-top: 30px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
  color: #666;
  font-size: 0.95rem;
}

/* 空状态 */
.empty {
  text-align: center;
  padding: 30px 0;
  color: #999;
}

/* 响应式 */
@media (max-width: 500px) {
  .input-group {
    flex-direction: column;
  }
  #addBtn {
    width: 100%;
  }
  .filters {
    flex-wrap: wrap;
  }
  .filter-btn {
    flex: 1;
    min-width: 80px;
  }
}
